//
// Created by f12160c on 2018/7/26.
//

#include <iostream>
#include <vector>
#include<gtest/gtest.h>

#include "leetcode/leetcode.hpp"

using namespace std;

namespace {
    TEST(test_divide, 1) {
        int a, b;

        /* overflow */
        a = -2147483648;
        b = -1;
        ASSERT_EQ(Solution::divide(a, b), 2147483647);

        a = 10;
        b = 3;
        ASSERT_EQ(Solution::divide(a, b), a/b);

        a = -56;
        b = -1;
        ASSERT_EQ(Solution::divide(a, b), a/b);

        a = -56;
        b = 10;
        ASSERT_EQ(Solution::divide(a, b), a/b);

        a = 78;
        b = -20;
        ASSERT_EQ(Solution::divide(a, b), a/b);

        a = 78;
        b = 7;
        ASSERT_EQ(Solution::divide(a, b), a/b);
    }

}